

package com.hazelcast.transaction;

import com.hazelcast.collection.IList;
import com.hazelcast.config.SplitBrainProtectionConfig;

/**
 * Transactional implementation of {@link IList}.
 * <p>
 * Supports split brain protection {@link SplitBrainProtectionConfig} since 3.10 in
 * cluster versions 3.10 and higher.
 *
 * @param <E> the type of elements maintained by this list
 */
public interface TransactionalList<E> extends TransactionalObject {

    /**
     * Adds a new item to the transactional list.
     *
     * @param e the new item added to the transactional list
     * @return {@code true} if the item is added successfully
     */
    boolean add(E e);

    /**
     * Removes an item from the transactional list.
     *
     * @param e item to remove the transactional list
     * @return {@code true} if the item is removed successfully
     */
    boolean remove(E e);

    /**
     * Returns the size of the list.
     *
     * @return the size of the list
     */
    int size();
}
